//
//  ComposeTitleView.swift
//  XLWB
//
//  Created by 郭亮 on 16/3/19.
//  Copyright © 2016年 gl. All rights reserved.
//

import UIKit
import SnapKit

class ComposeTitleView: UIView {
    
    // MARK:-懒加载属性
    private lazy var composeStatusLable: UILabel = UILabel()
    private lazy var userNameLable: UILabel = UILabel()

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupChildView()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupChildView()
    }
}

// MARK:-UI界面
extension ComposeTitleView {
    private func setupChildView() {
        //添加子控件
        addSubview(composeStatusLable)
        addSubview(userNameLable)
        //设置frame
        composeStatusLable.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self.snp_centerX)
            make.top.equalTo(self.snp_top)
        }
        userNameLable.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(composeStatusLable.snp_centerX)
            make.top.equalTo(composeStatusLable.snp_bottom).offset(3)
        }
        //设置属性
        composeStatusLable.text = "发微博"
        composeStatusLable.font = UIFont.systemFontOfSize(14)
        userNameLable.font = UIFont.systemFontOfSize(13)
        userNameLable.text = UserAccountViewModal.shareInstance.accessToken?.screen_name
        userNameLable.textColor = UIColor.lightGrayColor()
    }
}
